﻿using System;
using System.Collections;
using System.Collections.Generic;


namespace Petra.Gis.RenderingServices.PlanarBase 
{


  /// <summary>
  /// represents readonly enumerable collection of child nodes
  /// </summary>
  public class LegendChildNodes : IList<LegendNode> //, IEnumerable<LegendNode>, 
  {

    private List<LegendNode> _childs;
    private LeafLegendNode _parent;


    internal LegendChildNodes(LeafLegendNode parent, List<LegendNode> list)
    {
      _parent = parent;
      _childs = list;
    }



    public void Add(LegendNode item)
    {
      //_childs.Add(item);
    }



    public void Clear()
    {
      //_childs.Clear();
    }



    public bool Contains(LegendNode item)
    {
      return _childs.Contains(item);
    }



    public bool IsReadOnly
    {
      get { return true; }
    }


    public bool Remove(LegendNode item)
    {
      //return _childs.Remove(item);
      return false;
    }




    public void RemoveAt(int index)
    {

    }


    public int Count
    {
      get { return _childs.Count; }
    }



    public void CopyTo(LegendNode[] array, int arrayIndex)
    {

    }




    public IEnumerator<LegendNode> GetEnumerator()
    {
      return _childs.GetEnumerator();
    }




    IEnumerator IEnumerable.GetEnumerator()
    {
      return GetEnumerator();
    }



    public void MoveNode(int nodeIndex, int newPositionIndex)
    {

    }



    public LegendNode this[int index]
    {
      get { return _childs[index]; }
      set { }
    }



    public int IndexOf(LegendNode item)
    {
      return _childs.IndexOf(item);
    }



    public void Insert(int index, LegendNode item)
    {
      //_childs.Insert(index, item);
    }


  }
}
